package com.seashop.util;

import com.seashop.constant.BaseConstant;
import com.seashop.enums.CountryCodeEnum;

/**
 * @author moredln
 * @desc
 * @date 2020-10-28 17:02
 */
public class MessageUtil {

    public static String handleMobile(String mobile) {
        if (mobile.startsWith("66") || mobile.startsWith("62")) {
            String substring = mobile.substring(2, 3);
            if ("0".equals(substring)) {
                mobile = mobile.replaceFirst("0", "");
            }
        }
        return mobile;
    }

    public static String getMessageTemplate(String countryCode) {
        if (CountryCodeEnum.TH.getLanguageType().equals(countryCode)) {
            return BaseConstant.SMS_CODE_TH;
        } else {
            return BaseConstant.SMS_CODE_EN;
        }
    }

}
